package com.qyc.controller;

import com.qyc.service.AccountService;
import com.qyc.utils.ResponseResult;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestHeader;
import org.springframework.web.bind.annotation.RestController;
import springfox.documentation.annotations.ApiIgnore;

/**
 * @className: AccountController
 * @Description: 用户相关Controller
 * @author: qinyc
 * @date: 2023/6/21 19:24
 * @version: v1.0
 */

@Api(tags = "用户模块")
@RestController

public class AccountController {

    //注入用户Service层对象
    @Autowired
    private AccountService accountService;

    /**
     * @Author qinyc
     * @Description  获取当前用户信息
     * @version: v1.0
     * @Date 1:20 2023/6/22
     **/
    @ApiOperation("获取当前用户信息")
    @GetMapping("/me")
    public ResponseResult getAccountInfo(@ApiIgnore @RequestHeader String token){
        return accountService.getAccountInfo(token);
    }

}
